#ifndef REGISTER_H
#define REGISTER_H
#include <QDialog>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QTcpSocket>


namespace Ui {
class Register;
}

class Register : public QDialog
{
    Q_OBJECT

public:
    explicit Register(QWidget *parent = nullptr);
    ~Register();
    bool isAccountExit(QSqlDatabase database,const QString&acc);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private slots:
    void on_regist_clicked();
    void acc_changed();
    void on_toolButton_clicked();
    void on_toolButton_2_clicked();
    void onConnected();
    void onDisconnected();
    void onReadyRead();

private:
    Ui::Register *ui;
    QString myaccount;
    QPoint windowPos;
    QPoint mousePos;
    QPoint dPos;
    QTcpSocket *tcpSocket1;
};

#endif // REGISTER_H
